import {$get, $put} from '@js/request'
import {ServiceResultSchema} from '@components/schema/service'

// 获取电子送达结果
export async function getElectronicResultRequest (deliverid: string): Promise<ServiceResultSchema[]> {
  const res = await $get('/api/commission/deliver/getDigitalDeliverResult', {
    deliverid
  })
  return res.data
}

// 更新送达
export async function updateServiceRequest (id: string, data: any) {
  const res = await $put(`/api/commission/deliver/${id}`, data)
  if (res.status !== 1) {
    throw new Error(res.message)
  }
  return res.data
}
